#ifndef GIFFILTERPROXYMODEL_H
#define GIFFILTERPROXYMODEL_H

#include <QSortFilterProxyModel>

class GifFilterProxyModel : public QSortFilterProxyModel
{
    Q_OBJECT
    Q_PROPERTY(bool filterEnabled READ filterEnabled WRITE setFilterEnabled NOTIFY filterEnabledChanged FINAL)
    Q_PROPERTY(QStringList disguisedGifs READ disguisedGifs WRITE setDisguisedGifs NOTIFY disguisedGifsChanged FINAL)
public:
    explicit GifFilterProxyModel(QObject *parent = nullptr);

    bool filterEnabled() const;
    void setFilterEnabled(bool newFilterEnabled);
    QStringList disguisedGifs() const;
    void setDisguisedGifs(const QStringList &newDisguisedGifs);

signals:
    void filterEnabledChanged();
    void disguisedGifsChanged();

private:
    bool m_filterEnabled;
    QStringList m_disguisedGifs; // 存放伪装成 png/jpg 的 GIF 文件路径

    // QSortFilterProxyModel interface
protected:
    bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
};

#endif // GIFFILTERPROXYMODEL_H
